<?php

class Login extends Controller {
	function index()
	{
		if (isset($_POST['submit']))
		{
			$u = new User();
			if ($u->login($_POST['user'], $_POST['pass']))
				redirect("/userpanel");
			else
				redirect("/");
		} else {
			redirect("/");
		}
	}
}
?>